package com.example.android.BluetoothChat.bean;

import java.io.Serializable;

import com.example.android.BluetoothChat.constants.EnumPlayerType;

public class Player implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String _bluetoothMacAddress;
	private String _name;
	private EnumPlayerType _playerType;

	
	public EnumPlayerType getPlayerType() {
		return _playerType;
	}

	public void setPlayerType(EnumPlayerType playerType) {
		this._playerType = playerType;
	}

	public String getName() {
		return _name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((_bluetoothMacAddress == null) ? 0 : _bluetoothMacAddress
						.hashCode());
		result = prime * result + ((_name == null) ? 0 : _name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Player other = (Player) obj;
		if (_bluetoothMacAddress == null) {
			if (other._bluetoothMacAddress != null)
				return false;
		} else if (!_bluetoothMacAddress.equals(other._bluetoothMacAddress))
			return false;
		if (_name == null) {
			if (other._name != null)
				return false;
		} else if (!_name.equals(other._name))
			return false;
		return true;
	}

	public void setName(String parName) {
		this._name = parName;
	}

	
	public String getBluetoothMacAddress() {
		return _bluetoothMacAddress;
	}

	public void setBluetoothMacAddress(String parBuetoothMacAddress) {
		this._bluetoothMacAddress = parBuetoothMacAddress;
	}

	public Player(){
		
	}
	
	@Override
	public String toString() {
		return this._name;
	}
}
